package com.jackstraw.jack_base.datasource.mybatis.service.impl;

import com.jackstraw.jack_base.datasource.common.aspect.annotation.DataSourceNameCut;
import com.jackstraw.jack_base.datasource.common.entity.enums.DataSourceTypeEnum;
import com.jackstraw.jack_base.datasource.mybatis.base.service.impl.MyBatisServiceImpl;
import com.jackstraw.jack_base.datasource.mybatis.dao.database.UserDao;
import com.jackstraw.jack_base.datasource.mybatis.entity.bo.UserBo;
import com.jackstraw.jack_base.datasource.mybatis.entity.po.UserPo;
import com.jackstraw.jack_base.datasource.mybatis.entity.po.UserKeyPo;
import com.jackstraw.jack_base.datasource.mybatis.entity.po.UserPoExample;
import com.jackstraw.jack_base.datasource.mybatis.service.UserService;
import lombok.extern.slf4j.Slf4j;

import java.util.Map;

/**
 * 用户表  service实现类
 *
 * @author jack 945514650@qq.com
 * @since version:1.0 generatorDate:2022-05-21 21:29:36
 */
@Slf4j
@DataSourceNameCut(dataSourceName = "dataBaseName1", dataSourceTypeEnum = DataSourceTypeEnum.database)
public class UserServiceImpl
        extends MyBatisServiceImpl<UserDao, UserPo, UserBo, UserKeyPo<UserPo>, UserPoExample>
        implements UserService {


    @Override
    protected UserPoExample pe(Map<String, Object> params) {
        UserPoExample pe = super.pe(params);
        //默认查询主键
        pe.addKey(params);
        return pe;
    }

}
